using System;
using System.Windows.Forms;
using ComputerVision.Forms;
using ComputerVision.LoaiXeForm;
using ComputerVision.Role;
using ComputerVision.User;
using ComputerVision.VeXeForm;

namespace ComputerVision
{
    public partial class frmMain : Form
    {
        public frmMain()
        {
            InitializeComponent();
        }

        #region Closed

        private void ExitToolsStripMenuItem_Click(object sender, EventArgs e)
        {
            foreach (Form openForm in Application.OpenForms)
            {
                openForm.Close();
            }
            Application.Exit();
        }

        #endregion

        private void mnuInfo_Click(object sender, EventArgs e)
        {
            var frm = new frmInformation();
            frm.ShowDialog();
        }

        private void CloseMainForm(object sender, FormClosedEventArgs e)
        {
            while (Application.OpenForms.Count > 0)
            {
                Application.OpenForms[0].Close();
            }
        }

        private void mnuItemLogin_Click(object sender, EventArgs e)
        {
            var frm = new frmLogin();
            frm.Show();
            Hide();
        }

        private void mnuItemChangePassword_Click(object sender, EventArgs e)
        {
            var frm = new frmChangePassword();
            frm.ShowDialog();
        }

        private void mnuItemRoles_Click(object sender, EventArgs e)
        {
            var frm = new frmRoleList();
            frm.MdiParent = this;
            frm.WindowState = FormWindowState.Maximized;
            frm.Show();
        }

        private void mnuItemUserInRole_Click(object sender, EventArgs e)
        {
            var frm = new frmUserInRole();
            frm.MdiParent = this;
            frm.WindowState = FormWindowState.Maximized;
            frm.Show();
        }

        private void mnuItemInitCamera_Click(object sender, EventArgs e)
        {
            var frm = new frmConfigCamera();
            frm.ShowDialog();
        }

        private void mnuItemXeVao_Click(object sender, EventArgs e)
        {
            var frm = new frmXeVao();
            frm.MdiParent = this;
            frm.WindowState = FormWindowState.Maximized;
            frm.Show();
        }

        private void mnuItemXeRa_Click(object sender, EventArgs e)
        {
            var frm = new frmXeRa();
            frm.MdiParent = this;
            frm.WindowState = FormWindowState.Maximized;
            frm.Show();
        }

        private void mnuItemListUser_Click(object sender, EventArgs e)
        {
            var frm = new frmUserList();
            frm.MdiParent = this;
            frm.WindowState = FormWindowState.Maximized;
            frm.Show();
        }

        private void mnuLoaiXe_Click(object sender, EventArgs e)
        {
            var frm = new frmLoaiXeList();
            frm.MdiParent = this;
            frm.WindowState = FormWindowState.Maximized;
            frm.Show();
        }

        private void mnuItemVeXe_Click(object sender, EventArgs e)
        {
            var frm = new frmVeXeList();
            frm.MdiParent = this;
            frm.WindowState = FormWindowState.Maximized;
            frm.Show();
        }

        private void trainningCharacterToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var frm = new frmTrainningCharacter();
            frm.MdiParent = this;
            frm.WindowState = FormWindowState.Maximized;
            frm.Show();
        }
    }
}